package main

import (
	"encoding/json"
	"fmt"
	"log"
)

type Account2 struct {
	Email    string
	password string
	Money    float64
}

type User2 struct {
	Name     string
	Age      int
	Roles    []string
	Skill    map[string]float64
	Account2 Account2
	Level    map[string]interface{}
}

func main() {

	skill := make(map[string]float64)

	skill["python"] = 99.5
	skill["elixir"] = 90
	skill["ruby"] = 80.0

	account := Account2{
		Email:    "rsj217@gmail.com",
		password: "123456",
		Money:    100.5,
	}

	level := make(map[string]interface{})

	level["web"] = "Good"
	level["server"] = 90
	level["tool"] = nil

	user := User2{
		Name:     "rsj217",
		Age:      27,
		Roles:    []string{"Owner", "Master"},
		Skill:    skill,
		Account2: account,
		Level:    level,
	}

	rs, err := json.Marshal(user)
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println(string(rs))
}
